<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
	<META NAME="GENERATOR" Content="Visual Page 2.0 for Windows">
	<TITLE>SchemaFactory Sample</TITLE>
</HEAD>

<BODY>

<PRE>   static void createSchema(){
         ARServerUser context=new ARServerUser(&quot;Demo&quot;,&quot;&quot;,&quot;&quot;,&quot;romulan&quot;);
         try {
            SchemaFactory schemaMan = SchemaFactory.<SAMP><SPAN STYLE="Background-Color : #F7EC22"><FONT COLOR="black">getFactory</FONT></SPAN><SPAN
STYLE="Background-Color : #F7EC22">()</SPAN></SAMP>;

            Schema schema = (Schema)schemaMan.<SPAN STYLE="Background-Color : #00FF0F">newInstance()</SPAN>;
            schema.setContext(context);

            NameID name = new NameID(&quot;#arjoo-NewSchema&quot;);
            schema.setName(name);
            schema.<SPAN STYLE="Background-Color : #F7EC22">setSchemaType</SPAN>(1, null);
            PermissionInfo[] permissions = {new PermissionInfo(new InternalID(10), 1), new PermissionInfo(new InternalID(7),2)};
            schema.setPermissions(permissions);
            SortInfo sort = new SortInfo(new FieldID(8), 1);
            SortInfo[] sortarr = {sort};
            schema.setSortInfo(sortarr);
            InternalID[] id = {new InternalID(8)};
            schema.setAdminGrpList(id);
            IndexInfo[] index = {new IndexInfo(id, false, new NameID(&quot;test&quot;))};
            schema.setIndexInfo(index);
            schema.setDiary(&quot;diary test&quot;);
            EntryListFieldInfo[] fldInfos= {new EntryListFieldInfo(new FieldID(3),2,&quot;yyy&quot;), new EntryListFieldInfo(new FieldID(3),2,&quot;yyy&quot;)};
            schema.setEntryListFieldInfo(fldInfos);
            schema.<SPAN STYLE="Background-Color : #F7EC22">create()</SPAN>;

            schemaMan.<SPAN STYLE="Background-Color : #00FF0F">releaseInstance</SPAN>(schema);
         }

         catch(ARException e) {
            e.describe();
         }

         finally {
            context.clear();
            System.out.print(&quot;\n finally...outta arjoo\n&quot;);
         }
      }

   </PRE>

</BODY>

</HTML>